<template>
  <div class="btn-footer">
    <a-button key="back" @click="handleCancel" v-if="isShowCancel">
      {{ cancelText }}
    </a-button>
    <a-button
      key="submit"
      type="primary"
      :loading="loading"
      @click="handleOk"
      v-if="isShowOk"
    >
      {{ okText }}
    </a-button>
  </div>
</template>
<script>
export default {
  name: "BtnFooter",
  props: {
    loading: {
      type: Boolean,
      default: false,
    },
    cancelText: {
      type: String,
      default: "取消",
    },
    okText: {
      type: String,
      default: "确定",
    },
    isShowCancel: {
      type: Boolean,
      default: true,
    },
    isShowOk: {
      type: Boolean,
      default: true,
    },
  },
  methods: {
    handleCancel() {
      this.$emit("cancel");
    },
    handleOk() {
      this.$emit("ok");
    },
  },
};
</script>
